﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using WyUnity.Data.Query;
using WyUnity.Data.TableMapper;

namespace RFID_Interface.DTO
{

    public class Dep : ViewBase<Dep>
    {
        [Map]
        public string Number { get; set; }
        [Map]
        public string Name { get; set; }


        public static FieldBase pNumber = new Field<Dep>(p => p.Number);
        public static FieldBase pName = new Field<Dep>(p => p.Name);
        public override string GetSQLClip()
        {
            return @"SELECT  FNumber Number , FName Name
FROM    t_Department AS td 
WHERE FDeleted=0";
        }
        public static List<Dep> GetAll()
        {
            using (var db = DB.Open())
            {
                return db.QueryList<Dep>(null, pNumber.Arc);
            }
        }
    }
}